package com.mojie.overscroll.demo.recyclerview

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import com.mojie.overscroll.damp.RecyclerViewDampEdgeEffect
import com.mojie.overscroll.demo.databinding.ActivityRecyclerViewBinding

/**
 *
 * @Author:         lxp
 * @CreateDate:     2024/8/8
 */
class RecyclerViewDampActivity : AppCompatActivity() {

    private val binding by lazy { ActivityRecyclerViewBinding.inflate(layoutInflater) }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(binding.root)
        binding.recyclerView.apply {
            layoutManager = LinearLayoutManager(this@RecyclerViewDampActivity)
            addItemDecoration(SpaceItemDecoration(35,35))
            edgeEffectFactory = RecyclerViewDampEdgeEffect()
            adapter = RecyclerViewAdapter().apply {
                freshData(10)
            }
        }
    }


}